CREATE SEQUENCE IF NOT EXISTS public."OTRoomAvailability_OTRoomAvailabilityId_seq"
    INCREMENT 1
    START 1
    MINVALUE 1
    MAXVALUE 2147483647
    CACHE 1;
-- Table: public.OTRoomAvailability

-- DROP TABLE IF EXISTS public."OTRoomAvailability";

CREATE TABLE IF NOT EXISTS public."OTRoomAvailability"
(
    "OTRoomAvailabilityId" integer NOT NULL DEFAULT nextval('"OTRoomAvailability_OTRoomAvailabilityId_seq"'::regclass),
    "OTRoomId" integer,
    "Availability" text COLLATE pg_catalog."default",
    "LocationId" integer,
    "Active" boolean DEFAULT true,
    "CreatedBy" integer,
    "CreatedDate" timestamp without time zone,
    "ModifiedBy" integer,
    "ModifiedDate" timestamp without time zone,
    "FromDate" timestamp(6) without time zone,
    "ToDate" timestamp(6) without time zone,
    "AvailableDays" text COLLATE pg_catalog."default",
    "FromTime" text COLLATE pg_catalog."default",
    "ToTime" text COLLATE pg_catalog."default",
    CONSTRAINT "OTRoomAvailability_pkey" PRIMARY KEY ("OTRoomAvailabilityId"),
    CONSTRAINT "OTRoomAvailability_CreatedBy_fkey" FOREIGN KEY ("CreatedBy")
        REFERENCES public."Account" ("AccountId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION,
    CONSTRAINT "OTRoomAvailability_LocationId_fkey" FOREIGN KEY ("LocationId")
        REFERENCES public."Location" ("LocationId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION,
    CONSTRAINT "OTRoomAvailability_ModifiedBy_fkey" FOREIGN KEY ("ModifiedBy")
        REFERENCES public."Account" ("AccountId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION,
    CONSTRAINT "OTRoomAvailability_OTRoomId_fkey" FOREIGN KEY ("OTRoomId")
        REFERENCES public."OTRoom" ("OTRoomId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION
)

TABLESPACE pg_default;

ALTER TABLE IF EXISTS public."OTRoomAvailability"
    OWNER to postgres;